<?php


namespace Yond\LaravelDomain\Console\App;


use Yond\LaravelDomain\Console\AppGenerator;

class FilterMakeCommand extends AppGenerator
{

    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'yond:domain:filter {--name= : The name of filter to make}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Make a domain query builder filter';

    protected function getUserInputs(): array
    {
        $name = ucfirst($this->optionOrAsk('name', 'Please enter the name of the filter to make'));

        return [
            'path' => [
                'app' => $this->sectionName ? $this->appName.'/'.$this->sectionName : $this->appName,
                'file' => $name,
            ],
            'stub' => [
                'app' => $this->sectionName ? $this->appName.'\\'.$this->sectionName : $this->appName,
                'class' => $name,
            ],
        ];
    }

    protected function getStubName(): string
    {
        return 'filter.stub';
    }

    protected function getPathStructure(): string
    {
        return 'app/{app}/Filters/{file}.php';
    }
}
